package com.fanxuankai.boot.monitor.confluent;

import com.fanxuankai.boot.monitor.BaseMonitorProperties;
import com.fanxuankai.boot.monitor.autoconfigure.MonitorProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author fanxuankai
 */
@ConfigurationProperties(prefix = ConfluentConsumerLagProperties.PREFIX)
public class ConfluentConsumerLagProperties extends BaseMonitorProperties<ConfluentConsumerLagProperties.ConsumerLagConfig> {
    public static final String PREFIX = MonitorProperties.PREFIX + ".confluent.consumer-lag";

    public ConfluentConsumerLagProperties() {
        setTitle("Confluent Consumer Lag");
        setCron("30 0/5 * * * ?");
    }

    public static class ConsumerLagConfig {
        private String clusters;
        private String url = "/2.0/consumer/offsets";
        private String healthStatusUrl = "/2.0/health/status";
        private long threshold;

        public String getClusters() {
            return clusters;
        }

        public void setClusters(String clusters) {
            this.clusters = clusters;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getHealthStatusUrl() {
            return healthStatusUrl;
        }

        public void setHealthStatusUrl(String healthStatusUrl) {
            this.healthStatusUrl = healthStatusUrl;
        }

        public long getThreshold() {
            return threshold;
        }

        public void setThreshold(long threshold) {
            this.threshold = threshold;
        }
    }
}
